test<?php

require_once("classes/db_functions.php");
require_once("classes/functions.php");
require_once("classes/xml.class.php");

$xml = new xml_yp("xml/volks.xml");
$xml->parse();

//print_rarray($xml->_struct); die();
$data = array();
$data = array_merge($data,$xml->get_elements("trnlist",3,array("open")));
$data = array_merge($data,$xml->get_elements("benefit",5));
$data = array_merge($data,$xml->get_elements("stmtnumber",3));
$data = array_merge($data,$xml->get_elements("name",6));
$data = array_merge($data,$xml->get_elements("acctid",6));
$data = array_merge($data,$xml->get_elements("bankid",6));
$data = array_merge($data,$xml->get_elements("trnamt",5));
$data = array_merge($data,$xml->get_elements("refnumber",5));

print_rarray($data);



/*
if(!@$db->select2("SELECT * FROM asda")){
	printf($db->errorMessage(),$db->getDBName(),"asda");
}else{
	echo "OK";
}
*/



/*file_put_contents("pera",utf2latin("Jovanović šđšž"));

function utf2latin($str){
	$utf = array("č","Č","ć","Ć","š","Š","đ","Đ","ž","Ž");
	$lat = array();
	
	foreach ($utf as $char){
		$tmp = preg_split('/(.{1})/',$char,-1,PREG_SPLIT_DELIM_CAPTURE);
		foreach ($tmp as $k=>$c){
			if(strlen($c)){
				$lat[$char][] = ord($c)." ";
			}
		}
	}
	
	foreach ($utf as $c){
		$cl = "";
		foreach ($lat[$c] as $int){
			$cl .= chr($int);
		}
		$str = preg_replace('/'.$c.'/',$cl,$str);
	}
	return $str;
}
*/

?>